package com.nobug.service.dashboard;

import com.nobug.bean.dashboard.DashBoardDataBean;
import com.nobug.mapper.dashboardMapper.DashBoardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DashBoardServiceImpl implements DashBoardService{
    @Autowired
    DashBoardMapper mapper;
    @Override
    public DashBoardDataBean dashBoard() {
        DashBoardDataBean dashBoardDataBean = new DashBoardDataBean();
        dashBoardDataBean.setGoodsTotal(mapper.countAllGoods());
        dashBoardDataBean.setOrderTotal(mapper.countAllOrder());
        dashBoardDataBean.setProductTotal(mapper.countAllGoodsProduct());
        dashBoardDataBean.setUserTotal(mapper.countAllUser());
        return dashBoardDataBean;
    }
}
